appchooserwidget: Update to using GdkEvent API
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 25 Aug 2017 14:42:39 +0000 (16:42 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 19 Sep 2017 16:39:02 +0000 (18:39 +0200)
gtk/gtkappchooserwidget.c

index 1cd3b1458b3c26a0e7590e1aa46fae91b7eddf1e..54b22a28c216d118f995f72b8efc9e762f046eb1 100644 (file)
@@ -188,9 +188,13 @@ get_app_info_for_event (GtkAppChooserWidget *self,
   GtkTreeModel *model;
   GAppInfo *info;
   gboolean recommended;
+  gdouble x, y;
+
+  if (!gdk_event_get_coords ((GdkEvent *) event, &x, &y))
+    return GDK_EVENT_PROPAGATE;
 
   if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (self->priv->program_list),
-                                      event->x, event->y,
+                                      x, y,
                                       &path,
                                       NULL, NULL, NULL))
     return NULL;
@@ -230,8 +234,11 @@ widget_button_press_event_cb (GtkWidget      *widget,
                               gpointer        user_data)
 {
   GtkAppChooserWidget *self = user_data;
+  guint button;
 
-  if (event->button == GDK_BUTTON_SECONDARY && event->type == GDK_BUTTON_PRESS)
+  if (gdk_event_get_button ((GdkEvent *) event, &button) &&
+      button == GDK_BUTTON_SECONDARY &&
+      gdk_event_get_event_type ((GdkEvent *) event) == GDK_BUTTON_PRESS)
     {
       GAppInfo *info;
       GtkWidget *menu;